package es.ucm.fdi.isbc.marcado.vista;

import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;

import javax.swing.JTextField;

public class JTextFieldFoco extends JTextField {

	private static final long serialVersionUID = 1L;

	public JTextFieldFoco() {
		super();
		creaFoco();
	}

	public JTextFieldFoco(String texto) {
		super(texto);
		creaFoco();
	}

	/* PRIVADO */
	private void creaFoco() {
		addFocusListener(new FocusAdapter() {

			public void focusGained(FocusEvent e) {
				selectAll();
			}
		});
	}
}
